package org.lionsoul.websnail.downloader.webdriver;

import org.lionsoul.websnail.downloader.WebDriverProcessor;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedCondition;

/**
 * @author yangjian
 */
public interface WebDriverBuilder
{

    // create a SnailWebDriver instance
    SnailWebDriver build(WebDriverProcessor processor);

    // 设置页面加载完成条件
    void setCondition(ExpectedCondition<WebElement> condition);

    // 设置页面元素选择器，如果没有设置，则返回整个页面的 HTML 代码
    void setSelector(By selector);

    // close WebDriver window and free resources
    void close();
}
